#pragma once
//#include <comutil.h>

#define MAKEID_X(point)		(point)
#define MAKEID_Y(point)		(point+1)
#define MAKEID_Z(point)		(point+2)

class CVarListImp;
class _variant_t;
class CPointProxy;
class IVarListVisitor;
class IVarListUpdater;

class GEOMDBAPI CVarList
{
public:
	CVarList(void);
	~CVarList(void);

	void SetID(const CString& szID);
	const CString& ID(void);

	void SetValue(UINT idx, Standard_Real value);
	bool GetValue(UINT idx, Standard_Real& value) const;

	void SetValue(UINT idx, Standard_Integer value);
	bool GetValue(UINT idx, Standard_Integer& value) const;

	void SetValue(UINT idx, const CString& value);
	bool GetValue(UINT idx, CString& value) const;

	void SetValue(UINT idx, const _variant_t& value);
	bool GetValue(UINT idx, _variant_t& value) const;

	void SetValue(UINT idx, const CPointProxy& value);
	bool GetValue(UINT idx, CPointProxy& value) const;

	void VisitItems(IVarListVisitor& visitor) const;
	void UpdateItems(IVarListUpdater& updater);
private:
	CVarList(const CVarList&);
	CVarList& operator=(const CVarList&);
	CString	m_szID;
	CVarListImp* m_pVarImp;
};
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
class GEOMDBAPI CPointProxy
{
public:
	CPointProxy();
	~CPointProxy();

	CPointProxy(const gp_Pnt& point);
	CPointProxy(const gp_Dir& point);

	operator gp_Pnt() const;
	operator gp_Dir() const;

	Standard_Real X() const;
	Standard_Real Y() const;
	Standard_Real Z() const;
	void SetX(Standard_Real X);
	void SetY(Standard_Real Y);
	void SetZ(Standard_Real Z);

	void XYZ(Standard_Real& x, Standard_Real& y, Standard_Real& z) const;
	void SetXYZ(Standard_Real x, Standard_Real y, Standard_Real z);
private:
	Standard_Real x;
	Standard_Real y;
	Standard_Real z;
};